package br.com.aspas.persistencia;

import br.com.aspas.modelo.TipoInscricao;
import br.com.aspas.util.AbstractDAO;
import java.util.List;

public class TipoInscricaoDao extends AbstractDAO {

    public void inserir(TipoInscricao tipoInscricao) {
        insert(tipoInscricao);
    }

    public TipoInscricao findByPk(Integer pKey) {
        return (TipoInscricao) findByPk(TipoInscricao.class, pKey);
    }

    public Boolean remove(Integer id) {
        delete(id,TipoInscricao.class);
        return new Boolean(true);
    }

    public void altera(TipoInscricao tipoInscricao) {
        update(tipoInscricao);
    }

    public List<TipoInscricao> findAllTipoInscricao() {
        em = emf.createEntityManager();
        List<TipoInscricao> list = em.createQuery("SELECT object(t) FROM TipoInscricao t order by t.nome").getResultList();
        em.close();
        return list;
    }
}
